package cn.wolfcode.car.common.base.page;

import cn.wolfcode.car.common.web.StateType;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Getter;
import lombok.Setter;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class MyPageInfo<T>{
    private int code;           //返回值状态码：为0是表示成功
    private String msg;         //返回值信息

    private long total;
    private List<T> rows = new ArrayList<>();
    public MyPageInfo(){}
    public MyPageInfo(Page<T> page) {
        this.total = page.getTotal();
        this.rows = page.getRecords();
        this.code = StateType.SUCCESS.getValue();
    }
}
